<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

	
	<form:form modelAttribute="emp" action="${pageContext.request.contextPath}/emp" method="post">
		
		<c:if test="${emp.id == null }"><h1 id="title">新增员工</h1></c:if>
		<c:if test="${emp.id != null }">
			<h1 id="title">修改员工</h1>
			<form:hidden path="id"/>
			<input type="hidden" name="_method" value="put">
		</c:if>
		
		<p>姓名：<form:input path="name"/></p>
		<p>年龄： <form:input path="age"/></p>
		<p>生日： <form:input path="birthday"/></p>
		<p>部门： <form:input path="deptName"/></p>
		<p>地址： <form:input path="address"/></p>
		
		<button>提交</button>
		
	</form:form>
	
</body>
</html>